//
//  QYXFindTopicCategoryVc.m
//  OpenYourEyes
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 Google AdWords. All rights reserved.
//

#import "QYXFindTopicCategoryVc.h"
#import "QYXFindMoreSingleVC.h"
#import "AppDelegate.h"

@interface QYXFindTopicCategoryVc ()


@end

@implementation QYXFindTopicCategoryVc


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth / 4, 44)];
    titleLabel.text = [self.titleStr substringFromIndex:1];
    titleLabel.textAlignment = 1;
    titleLabel.font = [UIFont fontWithName:@"FZLTZCHJW--GB1-0" size:16];
    self.navigationItem.titleView = titleLabel;
    
    UIImage *image = [[UIImage imageNamed:@"back.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:self action:@selector(back)];
    
}

- (void)back
{

    [self.navigationController popViewControllerAnimated:YES];
}


- (UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index {
    switch (index) {
        case 0: {
            
            
            QYXFindMoreSingleVC *vc = [[QYXFindMoreSingleVC alloc] init];
            if (_ID == 1) {
                vc.url = @"http://baobab.wandoujia.com/api/v3/tag/videos?_s=d79f6e8317d30da6a9fb8f60f2f30193&f=iphone&net=wifi&num=20&start=0&strategy=date&tagId=658&u=ebe4ca1f9d83e4dc4f915b0495e6e1946ee0eb93&v=2.2.0&vc=721";
            }
            else
            {
            
            vc.url = [NSString stringWithFormat:@"http://baobab.wandoujia.com/api/v3/videos?start=20&num=20&categoryId=%lu&strategy=shareCount", _ID];
            }
            return vc;
        }
            break;
        case 1: {
            QYXFindMoreSingleVC *vc = [[QYXFindMoreSingleVC alloc] init];

             if (_ID == 1) {
                 vc.url = @"http://baobab.wandoujia.com/api/v3/tag/videos?_s=9e614786b33c946cee8bee64802d0630&f=iphone&net=wifi&num=20&start=0&strategy=shareCount&tagId=658&u=ebe4ca1f9d83e4dc4f915b0495e6e1946ee0eb93&v=2.2.0&vc=721";
             }
            else
            {
                
            vc.url = [NSString stringWithFormat:@"http://baobab.wandoujia.com/api/v3/videos?start=0&num=20&categoryId=%lu&strategy=date", _ID];
            }
            return vc;
        }
        default: {
            return nil;

        }
            break;
    }
}



@end
